-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
PERF: Quick Shift Implementation (GH5609) #6672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1910,9 +1907,20 @@ def fillna(self, value, limit=None, inplace=False, downcast=None): | |||
values = self.values if inplace else self.values.copy() | |||
return [self.make_block(values.get_values(value), fill_value=value)] | |||
|
|||
def shift(self, indexer, periods, axis=0): | |||
""" shift the block by periods """ | |||
@classmethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just make this a function defined inside shift itself. if its truly reusable them move to core/common
, but I don't think used anywhere else, so just move to inside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SparseDataFrame is using this shift_indexer. However I don't think it is reusable enough to move to core/common. I plan to revert back to original code. What do you think?
looks good.... if you feel comfortable squashing go ahead otherwise you can ping me when its green |
Added to note release.rst Move shift_indexer into the shift function Removed function _shift_indexer all together. Passes tests sparse. remove unwanted comments
I have squashed my commits. |
looks good...ping me when green |
Good to go! |
PERF: Quick Shift Implementation (GH5609)
@gouthambs thanks! next time will be easier! |
closes #5609
Test code
Results